﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CoreObjects.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            String url = Request.Url.ToString();

            ViewData["Message"] = "Welcome to ASP.NET MVC in the url " + url;

            HttpContext.Cache.Insert("time", DateTime.Now);


            return View();
        }

        public ActionResult About()
        {
            ViewData["Message"] = ((DateTime)HttpContext.Cache["time"]).ToLongTimeString();

            return View();
        }
    }
}
